/*
  学习目标：setState是异步行为
  步骤：
     1. 
     2. 
     3. 
*/
import React, { Component } from 'react';

export default class App extends Component {
  state = {
    count: 0,
  };

  handleClick = () => {
    this.setState({ count: this.state.count + 1 });
    this.setState({ count: this.state.count + 2 });
    this.setState({ count: this.state.count + 3 });
    // console.log('this.state.count  ----->  ', this.state.count);
  };

  render() {
    console.log('打印  ----->  ');
    return (
      <div>
        <button onClick={this.handleClick}>点我改变state</button>
        <h1>{this.state.count}</h1>
      </div>
    );
  }
}
